<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理页面</title>
<link href="{webroot}theme/admin/css/iframe.css" rel="stylesheet" type="text/css" />
<link href="{webroot}lib/css/jquery.colorpicker.css" rel="stylesheet" type="text/css" />
<link href="{webroot}lib/css/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
<script src="{webroot}lib/js/jquery.js"></script>
<script src="{webroot}lib/js/jquery-migrate-1.1.0.min.js"></script>
<script src="{webroot}lib/js/base.js"></script>
<script src="{webroot}lib/tips/jquery.tips.js"></script>
<script src="{webroot}lib/validator/jquery.validator.js"></script>
<script src="{webroot}lib/validator/zh_CN.js"></script>
<script src="{webroot}lib/js/jquery.livequery.js"></script>
<script src="{webroot}lib/js/jquery.colorpicker.js"></script>
<script src="{webroot}lib/js/jquery.autocomplete.js"></script>
<script src="{webroot}theme/admin/js/admin.js"></script>
<script src="{webroot}lib/dialog/artdialog.js"></script>
<!--[if lt IE 9]>
<script src="{webroot}lib/js/html5.js"></script>
<![endif]-->
</head>
<body>

<div class="layout-center">
	<div class="right_subject">当前位置：扩展 > <a href="?">评论管理</a> > <a href="?act=config">评论配置</a></div>
    <div class="right_body">
        <div class="table_form">
            <form class="formname" method="post">
                <div class="form_group">
                    <div class="form_txt">评论开关：</div>
                    <div class="form_input">
                    <input type="radio" name="t0" value="true" id="t0_0" {if data(0)}checked{/if} />
                    <label for="t0_0">开启</label>
                    <input type="radio" name="t0" value="false" id="t0_1" {if not(data(0))}checked{/if} />
                    <label for="t0_1">关闭</label> 
                    </div>
                </div>
                <div class="form_group">
                    <div class="form_txt">评论审核：</div>
                    <div class="form_input">
                    <input type="radio" name="t1" value="true" id="t1_0" {if data(1)}checked{/if} />
                    <label for="t1_0">开启</label>
                    <input type="radio" name="t1" value="false" id="t1_1" {if not(data(1))}checked{/if} />
                    <label for="t1_1">关闭</label>
                    </div>
                </div>
                <div class="form_group">
                    <div class="form_txt">会员才能评论：</div>
                    <div class="form_input">
                    <input type="radio" name="t2" value="true" id="t2_0" {if data(2)}checked{/if} />
                    <label for="t2_0">开启</label>
                    <input type="radio" name="t2" value="false" id="t2_1" {if not(data(2))}checked{/if} />
                    <label for="t2_1">关闭</label>
                    </div>
                </div>
                <div class="form_group">
                    <div class="form_bnt"><input type="submit" value="保存" class="bnt_save"><input type="button" value="返回" class="bnt_normal goback"></div>
                </div>
            </form>
        </div>
    </div>
</div>

<script>
$(".formname").validator(
	{
		stopOnError:true,
        theme:'yellow_top',
		ignore:':hidden',
		beforeSubmit:function(){$("input[type='submit']").attr("disabled",true);},
		valid:function(form)
		{
			$.fn.tips({type:'loading',content:'数据提交中'});
			$.ajax(
			{
				url:"?act=configdb",
				type:"post",
				data:$(form).serialize(),
				success:function(data){
					data=jQuery.parseJSON(data);
					var type="warn";
					if(data.status=="y"){type="ok";}
					$.fn.tips({type:type,content:data.info});
					if(data.status=="y"){
						setTimeout("location.href='?act=config'",1000);
					}
					else
					{$("input[type='submit']").attr("disabled",false);}
					
				}
			});
		},
		invalid:function(){$("input[type='submit']").attr("disabled",false);}
	}
);
</script>
</body>
</html>